package TankGame05;

import javax.swing.*;
import java.awt.*;

public class TankGameFrame extends JFrame {
    MyPanel myPanel = null;
    public static void main(String[] args) {
        new TankGameFrame();
    }

    public TankGameFrame() throws HeadlessException {
        myPanel = new MyPanel();
        new Thread(myPanel).start();//启动线程
        this.add(myPanel);
        this.setSize(1000,750);//设置窗口宽高
        this.addKeyListener(myPanel);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//点击×退出
        this.setVisible(true);
    }
}
